/**
 *
 * 3.6+权限管理
 */
import Vue from 'vue'
import typeMutation from '../types/TypesMutation'
import typeAciton from '../types/TypesAction'
import localTypes from '../types/TypesLStorage'

const state = {

  authList: [

  ]
};
const mutations = {

  //存储用户的角色及对应的权限表到state
  [typeMutation.role.getAuths](state, authList){
    state.authList = authList;
  }

};
const actions =
  {
    //获取角色列表
    [typeAciton.role.queryRoleInfo]({commit}, authList)
    {
      Vue.prototype.$apiRole.getRoleList().then(function (response) {
        if (response.success) {
          commit(typeMutation.role.getAuths, authList);
        }
      });
    }

  } ;
const getters =
  {
    authList: state => {
      return state.authList;
    }
  };

export default {
  state, mutations, actions, getters
}


